// 公路舱单接口
import axios from '@/libs/api.request'

/**
 * 根据id查询舱单信息
 * @param {Number} manifestId 舱单id
 */
export function queryManifestById (manifestId) {
    return axios.request({
        url: '/customs/manifest/queryManifestById',
        params: {
            manifestId
        },
        method: 'get'
    })
}

export const getManifestBasicData = (data) => {
    return axios.request({
        url: '/customs/manifestBasicData/list',
        data: data,
        method: 'post'
    })
}

export const getDeclareBasicData = (data) => {
    return axios.request({
        url: '/ui/commonbasicdata/basicData/getCustomsBasicDataVo',
        data: data,
        method: 'post'
    })
}

// 查找货物运输批次号
export const queryDeclare = (data) => {
    return axios.request({
        url: '/customs/manifest/queryDeclareByCargoBatchNo',
        data: data,
        method: 'post'
    })
}

// 公路舱单列表
export const getManifestList = (data) => {
    return axios.request({
        url: '/customs/manifest/list',
        data: data,
        method: 'post'
    })
}

// 保存舱单
export const unifySaveManifest = (data) => {
    return axios.request({
        url: '/customs/manifest/unifySaveManifest',
        data: data,
        method: 'post'
    })
}

// 删除 申报舱单
export const sendManifestToSingleWindow = (data) => {
    return axios.request({
        url: '/customs/manifest/sendManifestToSingleWindow',
        data: data,
        method: 'post'
    })
}

// 回执信息
export const queryResponseRecords = (data) => {
    return axios.request({
        url: '/customs/manifestReceipt/queryResponseRecords',
        data: data,
        method: 'post'
    })
}

/**
 * 根据id删除舱单
 * @param {String} manifestId 舱单id
 */
export function deleteManifestById (manifestId) {
    return axios.request({
        url: '/customs/manifest/delete',
        params: {
            manifestId
        },
        method: 'post'
    })
}

/**
 * 批量申报舱单
 * @param {Array} requestSingleVoList 提运单集合
 */
export function batchSendManifestToSingleWindow (requestSingleVoList) {
    return axios.request({
        url: '/customs/manifest/batchSendManifestToSingleWindow',
        data: requestSingleVoList,
        method: 'post'
    })
}
